<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 

<%
	String path = request.getContextPath();
%>

<script type="text/javascript">
	function cutCount(){
		var count = $("#count").val();
		var membercardId = $("#membercardId").val();
		var customerId = $("#customerId").val();
		if (isNaN(parseInt(count))){
			alertMsg.error('请输入正确扣次数');
			return false;
		}
		$("#kouci_a_id").attr("href","<%=path %>/membercardcostcount/costCount.action?count="+count+"&membercardId="+membercardId+"&customerId="+customerId);
		$("#kouci_a_id").click();
	}

</script>	
 <!-- 
<form id="pagerForm" method="post" action="<%=path %>/memberCardCostCount/listMemberCardCostCount.action">
	<input type="hidden" name="pageRequest" value="1" />
	<input type="hidden" name="pageNum" value="${paginator.pageIndex}" />
	<input type="hidden" name="numPerPage" value="${paginator.pageSize}" />
</form>

<div class="pageHeader">
	<form onsubmit="return navTabSearch(this);" rel="pagerForm" action="<%=path %>/memberCardCostCount/listMemberCardCostCount.action" method="post">
	<div class="searchBar">
		<ul class="searchContent">
			<input type="hidden" name="pageRequest" value="1" />
		</ul>
		<div class="subBar">
		</div>
	</div>
	</form>
</div>
 -->
<div class="pageContent">
	 
	<div class="panelBar">
		<ul class="toolBar">
			<!-- 
			<li><a class="add" href="<%=path %>/memberCardCostCount/addMemberCardCostCount.action" target="navTab"><span>添加</span></a></li>
			<li><a title="确实要删除这些记录吗?" target="selectedTodo" rel="key" postType="string" href="<%=path %>/memberCardCostCount/deleteMemberCardCostCount.action" class="delete"><span>删除</span></a></li>
			<li><a class="edit" href="<%=path %>/memberCardCostCount/editMemberCardCostCount.action?memberCardCostCountVO.id={sid_user}" target="navTab" warn="请选择一条记录"><span>修改</span></a></li>
			 -->
			 <li>扣<input id="count" name="costVO.score" value="" class="require"/>次
			 		<input id="membercardId" name="membercardId" type="hidden" value="${costVO.cardEntity.id}" class="require"/>
			 		<input id="customerId" name="customerId" type="hidden" value="${costVO.cardEntity.customerId}" class="require"/>
			 </li>
			<li><a title="确实要扣次吗?" class="delete" postType="string" href="javascript:;" onclick="cutCount();"><span>扣次</span></a></li>
			<a id="kouci_a_id" title="确实要扣次吗?" target="selectedTodo" rel="key" postType="string" href="<%=path %>/membercardcostcount/costCount.action?count=${costVO.score}" class="delete" style="display:none"><span>扣次</span></a>
		</ul>
	</div>
	 
	<table class="table" width="1150" layoutH="138">
		<thead>
			<tr>
				<th width="30"><input type="checkbox" group="key" class="checkboxCtrl"></th>
				<th>会员卡</th>
				<th>商品</th>
				<th>次数</th>
				<!--<th width="70">操作</th>-->
			</tr>
		</thead>
		<tbody>
			<s:iterator value="memberCardCostCountList" id="memberCardCostCount" status="st">
				<tr target="sid_user" rel="<s:property value="id" />">
			 <td><input name="key" value="<s:property value="id" />" type="checkbox"></td>
             <td><s:property value="memberCard.memberName" /></td>
             <td><s:property value="product.name" /></td>
            <td><s:property value="count" /></td>
			 <!--		<td>
						<a title="确实要删除这条记录吗?" target="ajaxTodo" href="<%=path %>/memberCardCostCount/deleteMemberCardCostCount.action?key=<s:property value="id" />" class="btnDel">删除</a>
						<a title="编辑" target="navTab" href="<%=path %>/memberCardCostCount/editMemberCardCostCount.action?memberCardCostCountVO.id=<s:property value="id" />" class="btnEdit">编辑</a>
					</td> -->
				</tr>
			</s:iterator>
		</tbody>
	</table>
	<!--    
	<div class="panelBar">
		<div class="pages">
				<span>显示</span>
				<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
					<option value="15" <c:if test="${paginator.pageSize==15}">selected='selected'</c:if> >15</option>
					<option value="50" <c:if test="${paginator.pageSize==50}">selected='selected'</c:if> >50</option>
					<option value="100" <c:if test="${paginator.pageSize==100}">selected='selected'</c:if> >100</option>
					<option value="200" <c:if test="${paginator.pageSize==200}">selected='selected'</c:if> >200</option>
				</select>
				<span>条，共${paginator.totalCount}条</span>
			</div>
			<div class="pagination" targetType="navTab" totalCount="${paginator.totalCount}" 
				numPerPage="${paginator.pageSize}" pageNumShown="10" currentPage="${paginator.pageIndex}"></div>

	</div>
	-->
</div> 